package com.yuebao.config;


import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedissonConfig {
    //TO redis主从复制 sentinel监控redis集群
    @Bean
    public RedissonClient redissonClient(){
        //配置
        Config config=new Config();

        //单节点模式
        config.useSingleServer().setAddress("redis://localhost:6379").setPassword("933114641lbj");
        // 创建RedissonClient
        return Redisson.create(config);

    }
}
